package LocalServerMains;
import generalClasses.ProgramData;
import generalClasses.Server;
import udpKuponServer.CenterMulticastServer;
import LocalServerTcp.CenterLocalKuponsMultiServer;
import LocalServerThreads.RegistrationThread;


public class CenterLocalServerRun
{

	public static volatile int numOfMsgsSentNorth = 0;
	public static volatile int numOfMsgsSentCenter = 0;
	public static volatile int numOfMsgsSentSouth = 0;
	/**
	 * @param args
	 */
	public static void main(String[] args)
	{
		ProgramData programData=new ProgramData();
		Server centerServer = new Server("Server of the Center (TLV)",
										programData.getCenterServerAdress(),
										programData.getCenterServerPort(),
										ProgramData.LOCAL_SERVER, 
										ProgramData.ONLINE, 
										ProgramData.CENTER);
		
		
		RegistrationThread registrationThread = new RegistrationThread( centerServer );
		registrationThread.start();

		String[] emptyStringArray = {};
		try
		{
			CenterMulticastServer cms = new CenterMulticastServer();
			cms.main( emptyStringArray );
			
			CenterLocalKuponsMultiServer clkms = new CenterLocalKuponsMultiServer();
			clkms.main( emptyStringArray );
		}
		catch (Exception e)
		{
			e.printStackTrace();
			System.err.println("Exception cought in TempRunLocalServer: "+ e.getMessage() );
		}
	}

}